package edu.colorado.karl.login;

/**
 * This class stores information on a single user.
 * @author Addison LeMessurier
 * @version 3/2/08
 */

public class UserRecord {
	private int accessLevel;
	private String passwordMD5;

	/**
	 * This constructor initializes the user record properties.
	 */
	public UserRecord() {
		passwordMD5 = "";
		accessLevel = 0;
	}
	
	/**
	 * This is a copy constructor.
	 * @param _userRecord The record to duplicate.
	 */
	public UserRecord(UserRecord _userRecord) {
		passwordMD5 = _userRecord.getPasswordMD5();
		accessLevel = _userRecord.getAccessLevel();
	}
	
	/**
	 * Gets the access level for this user.
	 * @return the access level for this user.  1 indicates user, 2 indicates 
	 * admin.
	 */
	public int getAccessLevel() {
		return accessLevel;
	}
	
	/**
	 * Gets the MD5 hash of this user's password.
	 * @return a MD5 hash of the user's password.
	 */
	public String getPasswordMD5() {
		return passwordMD5;
	}
	
	/**
	 * Sets the access level for this user.
	 * @param value The new access level for the user.
	 */
	public void setAccessLevel(int value) {
		accessLevel = value;
	}
	
	/**
	 * Modifies the MD5 hash of this user's password.
	 * @param value The new MD5 hash for this user's password.
	 */
	public void setPasswordMD5(String value) {
		passwordMD5 = value;
	}
}
